package com.goodmr.passport.account;

import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.sql.Timestamp;

/**
 * 帐号数据实体
 *
 * @author <a href="mailto:bingdong13@msn.com">bigo</a>
 */
@Entity
@Table(name = "account")
@Data
class AccountEntity implements Serializable {

    private static final long serialVersionUID = -4211362596854868153L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    /**
     * 帐号
     */
    @Column(length = 100, nullable = false, unique = true)
    private String account;

    /**
     * 帐号状态（未激活、正常、锁定）
     */
    @Column(length = 3, nullable = false)
    private Integer status;

    /**
     * 创建时间
     */
    @Column(name = "created_at", nullable = false, updatable = false)
    private Timestamp createdAt;

    /**
     * 更新时间
     */
    @Column(name = "updated_at", nullable = false)
    private Timestamp updatedAt;
}
